package com.bwie.controller;

import com.bwie.pojo.Room;
import com.bwie.service.RoomService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lenovo
 */
@RestController
@RequestMapping("/service/room")
public class RoomController {

    @Autowired
    private RoomService roomService;

    @PostMapping("/list")
    public R list(@RequestBody PageInfoVo pageInfoVo){

       return roomService.roomList(pageInfoVo);
    }

    @PostMapping("/add")
    public R add(@RequestBody Room room){
        return roomService.addRoom(room);
    }


}
